#include <iostream>
#include <map>

using namespace std;


int main() {
    map<char, int> mp;
    mp.insert(pair<char, int>('a', 1));
    mp.insert(pair<char, int>('b', 2));
    mp.insert(pair<char, int>('b', 3));
    mp.insert(pair<char, int>('b', 4));
    cout << mp.count('b') << endl;


    map<char, int>::iterator iter;
    for(iter = mp.begin(); iter != mp.end(); iter++){
        cout<<iter->first<<"  "<<iter->second<<" "<<endl;
    }
    map<char, int>::iterator it = mp.find('b');
    if (it != mp.end()) {
        cout << it->second << endl;
    }
    mp.clear();
    if (mp.empty()){
        cout << "map已被清空" << endl;
    }

    mp.insert(pair<char, int>('a', 1));
    mp.insert(pair<char, int>('b', 2));

    cout << mp.size() << endl;
    mp.erase('a');
    cout << mp.size() << endl;

}